<template>
    <n-card>
        <n-table :single-line="false" :striped="true">
            <thead>
                <tr>
                    <th>学号</th>
                    <th>姓名</th>
                    <th>班级</th>
                </tr>
            </thead>
            <tbody>
                <tr v-for="student in chapterCount">
                    <td>
                        {{student.SID}}
                    </td>
                    <td>
                        {{student.studentName}}
                    </td>
                    <td>
                        {{student.claseName}}
                    </td>
                </tr>
            </tbody>
        </n-table>
    </n-card>
</template>
<script lang="ts" setup>
    import {onMounted, ref} from 'vue';
    import {countExam} from '@/api/teacher/chapter'
    
    const chapterCount:any = ref([]);

    const props = defineProps({
    MID: {
        type: String,Number,
        required: true
    }
    })

    onMounted(async() => {
        chapterCount.value = await countExam({MID:props.MID});
    })
</script>